package com.zhuimeng.redis_rocketmq.listen;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "REDISINCR",consumerGroup = "REDISINCRCONSUMER")
public class RedisIncrlistener implements RocketMQListener<String> {
    @Autowired
    RedisTemplate redisTemplate;
    private final String orderCount = "ORDERCOUNT";
    @Override
    public void onMessage(String s) {
        redisTemplate.boundValueOps(orderCount).increment();
    }
}
